package com.ruoyi.base.service.impl;

import java.util.List;

import cn.hutool.core.util.IdUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.base.mapper.MBasestaffMapper;
import com.ruoyi.base.domain.MBasestaff;
import com.ruoyi.base.service.IMBasestaffService;

/**
 * 基本资料Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-08-09
 */
@Service
public class MBasestaffServiceImpl implements IMBasestaffService 
{
    @Autowired
    private MBasestaffMapper mBasestaffMapper;

    /**
     * 查询基本资料
     * 
     * @param id 基本资料主键
     * @return 基本资料
     */
    @Override
    public MBasestaff selectMBasestaffById(Long id)
    {
        return mBasestaffMapper.selectMBasestaffById(id);
    }

    /**
     * 查询基本资料列表
     * 
     * @param mBasestaff 基本资料
     * @return 基本资料
     */
    @Override
    public List<MBasestaff> selectMBasestaffList(MBasestaff mBasestaff)
    {
        return mBasestaffMapper.selectMBasestaffList(mBasestaff);
    }

    /**
     * 新增基本资料
     * 
     * @param mBasestaff 基本资料
     * @return 结果
     */
    @Override
    public int insertMBasestaff(MBasestaff mBasestaff)
    {
        long sid = IdUtil.createSnowflake(1, 1).nextId();
        mBasestaff.setsId(sid);
        return mBasestaffMapper.insertMBasestaff(mBasestaff);
    }

    /**
     * 修改基本资料
     * 
     * @param mBasestaff 基本资料
     * @return 结果
     */
    @Override
    public int updateMBasestaff(MBasestaff mBasestaff)
    {
        return mBasestaffMapper.updateMBasestaff(mBasestaff);
    }

    /**
     * 批量删除基本资料
     * 
     * @param ids 需要删除的基本资料主键
     * @return 结果
     */
    @Override
    public int deleteMBasestaffByIds(Long[] ids)
    {
        return mBasestaffMapper.deleteMBasestaffByIds(ids);
    }

    /**
     * 删除基本资料信息
     * 
     * @param id 基本资料主键
     * @return 结果
     */
    @Override
    public int deleteMBasestaffById(Long id)
    {
        return mBasestaffMapper.deleteMBasestaffById(id);
    }

    @Override
    public List getSexList() {
        return mBasestaffMapper.getSexList();
    }
}
